import {Routes, RouterModule} from '@angular/router';
import {ProductComponent} from "./product/product.component";
import {HomeComponent} from "./home/home.component";
import {NgModule} from "@angular/core";
const appRoutes: Routes = [
    {
        //todo : 注意这里不要写成:"/home",这里不需要斜杠
        path: "home",
        component: HomeComponent
    },
    {
        path: 'product',
        component: ProductComponent
    },
    {
        path: "",
        redirectTo: "home",
        pathMatch: "full"
    },
    //todo : 这个相当于通配路由,404页面,应该放在所有路由的后面
    {
        path: "**",
        component: HomeComponent
    },
]
@NgModule({
    imports: [RouterModule.forRoot(appRoutes)],
    exports: [RouterModule],
    providers: []
})
export class AppRoutingModule {
}